package com.xjscrm.console.web.operatePlan;

import com.xjscrm.console.param.operatePlan.*;
import com.xjscrm.console.param.wwCustomer.BatchDeleTagKeywordDeviceDto;
import com.xjscrm.console.service.customer.operatePlan.TagKeyWordBatchService;
import com.xjscrm.console.service.customer.operatePlan.TagKeywordService;
import com.xjscrm.console.vo.MyPageInfo;
import com.xjscrm.console.vo.TaskTagKeywordVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "关键词标签管理", tags = "关键词标签管理")
@RestController
@RequestMapping(value = "/tagKeyword")
public class TagKeywordController {

    @Autowired
    private TagKeywordService tagKeywordService;

    @Autowired
    private TagKeyWordBatchService tagKeyWordBatchService;


    @ApiOperation(value = "新增关键词标签", notes = "新增关键词标签", response = Boolean.class)
    @PostMapping(value = "/addTagKeyword")
    public Object addTagKeyword(@RequestBody TaskTagKeywordDto taskTagAutoDto)throws Exception{
        tagKeywordService.addTagKeyword(taskTagAutoDto);
        return true;
    }

    @ApiOperation(value = "批量新增关键词标签与机器人关系", notes = "批量新增关键词标签与机器人关系", response = Boolean.class)
    @PostMapping(value = "/batchAddTagKeywordDevice")
    public Object batchAddTagKeywordDevice(@RequestBody TagKeywordDeviceDto tagKeywordDeviceDto)throws Exception{
        tagKeyWordBatchService.batchAddTagKeywordDevice(tagKeywordDeviceDto);
        return true;
    }


    @ApiOperation(value = "批量删除关键词标签与机器人关系", notes = "批量删除关键词标签与机器人关系", response = Boolean.class)
    @PostMapping(value = "/batchDeleTagKeywordDevice")
  public Object batchDeleTagKeywordDevice(@RequestBody BatchDeleTagKeywordDeviceDto batchDeleTagKeywordDeviceDto)throws Exception{
        tagKeyWordBatchService.batchDeleTagKeywordDevice(batchDeleTagKeywordDeviceDto);
        return true;
  }


    @ApiOperation(value = "获取关键词应用列表", notes = "获取关键词应用列表", response = Boolean.class)
    @PostMapping(value = "/getTagKeywordDevice")
    public Object getTagKeywordDevice(@RequestBody TaskTagKeywordDeviceQuery tagKeywordDeviceQuery)throws Exception{
      return   tagKeywordService.getTagKeywordDevice(tagKeywordDeviceQuery);
    }




    @ApiOperation(value = "查询关键词标签列表", notes = "查询关键词标签列表", response = TaskTagKeywordVo.class)
    @PostMapping(value = "/getTagKeywordList")
    public Object getTagKeywordList(@RequestBody TaskTagKeywordQuery taskTagKeywordQuery)throws Exception{
       return tagKeywordService.getTagKeywordList(taskTagKeywordQuery);
    }


    @ApiOperation(value = "修改关键词标签", notes = "修改关键词标签", response = Boolean.class)
    @PostMapping(value = "/updateTagKeyword")
    public Object updateTagKeyword(@RequestBody TaskTagKeywordDto taskTagAutoDto)throws Exception{
        tagKeywordService.updateTagKeyword(taskTagAutoDto);
       return true;
    }


    @ApiOperation(value = "批量删除关键词标签", notes = "批量删除关键词标签", response = Boolean.class)
    @PostMapping(value = "/batchDeleTagKeyword")
   public Object batchDeleTagKeyword(@RequestBody DeleTagKeywordDto deleTagKeywordDto)throws Exception{
        tagKeyWordBatchService.batchDeleTagKeyword(deleTagKeywordDto);
        return true;
   }

}
